import Vue from 'vue'
import Router from 'vue-router'
import Bugs from '@/components/Bugs'
import Index from '@/components/Index'
import Project from '@/components/ProjectMenu/ProjectMenu'
import Personal from '@/components/Personal'
import PersonalData from '@/components/personalData/personalData'
import Charts from "@/components/charts/charts"
import LoginBg from '@/components/login-bg/login-bg'
import Pie from "@/components/charts/pie"
import Mission from "@/components/mission/mission"
import Password from '@/components/password/password'
import SubmitBug from '@/components/submitBug/submitBug'
import BugsList from '@/components/bugsList/bugsList'
import Bug from '@/components/Bug'
import EditBug from '@/components/editBug/editBug'

Vue.use(Router)

export default new Router({
  routes: [{
      path: '/',
      redirect: '/login'
    },
    {
      path: '/',
      name: 'index',
      component: Index,
      children: [{
          path: '/submitBug',
          name: 'submitBug',
          component: SubmitBug
        },
        {
          path: '/project',
          component: Project
        },
        {
          path: '/bugs',
          name: 'bugs',
          component: BugsList
        },
        {
          path: '/bugDetail:id',
          name: 'bugDetail',
          component: Bug
        },
        {
          path: '/editBug:uid',
          name: 'editBug',
          component: EditBug
        },
        {
          path: '/personal',
          name: 'personal',
          component: Personal,
          children: [{
              path: '/personalData',
              component: PersonalData
            },
            {
              path: '/charts',
              component: Charts
            },
            {
              path: '/pie',
              component: Pie
            },
            {
              path: '/password',
              component: Password
            }
          ]
        },
        {
          path: '/mission',
          name: 'mission',
          component: Mission
        }
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: LoginBg
    }
  ]
})
